home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 August / MW 8 2003 CD1.iso / Inside Macworld / Product News / gimp-1.2.4.sit / gimp-1.2.4 / plug-ins / perl / Gimp / PDL.pm < prev    next >
Encoding:
Perl POD Document  |  2003-01-14  |  1.2 KB  |  48 lines

  1. package Gimp::PDL;
  2.  
  3. warn "use'ing Gimp::PDL is no longer necessary, please remove it!\n";
  4.  
  5. 1;
  6. __END__
  7.  
  8. =head1 NAME
  9.  
  10. Gimp::PDL - Overwrite Tile/Region functions to work with piddles.
  11. This module is obsolete, please remove any references to it.
  12.  
  13. =head1 SYNOPSIS
  14.  
  15.   use Gimp;
  16.   use Gimp::PDL;
  17.   use PDL;
  18.  
  19. =head1 DESCRIPTION
  20.  
  21. This module overwrites some methods of Gimp::Tile and Gimp::PixelRgn. The
  22. new functions return and accept piddles. The last argument (height) of
  23. C<gimp_pixel_rgn_set_rect> is calculated from the piddle. There is no
  24. other way to access the raw pixeldata in Gimp.
  25.  
  26. Some exmaples:
  27.  
  28.  $region = $drawable->get->pixel_rgn (0,0, 100,100, 1,0);
  29.  $pixel = $region->get_pixel (5,7);    # fetches the pixel from (5|7)
  30.  print $pixel;                # outputs something like
  31.                      # [255, 127, 0], i.e. in
  32.                      # RGB format ;)
  33.  $region->set_pixel ($pixel * 0.5, 5, 7);# darken the pixel
  34.  $rect = $region->get_rect (3,3,70,20);    # get a horizontal stripe
  35.  $rect = $rect->hclip(255/5)*5;        # clip and multiply by 5
  36.  $region->set_rect($rect);        # and draw it!
  37.  undef $region;                # and update it!
  38.  
  39. =head1 AUTHOR
  40.  
  41. Marc Lehmann <pcg@goof.com>
  42.  
  43. =head1 SEE ALSO
  44.  
  45. L<Gimp::Pixel>, perl(1), Gimp(1).
  46.  
  47. =cut
  48.